Carbon introduces substantial changes to the printing model. The original Printing Manager defined in Printing.h is replaced by a new Carbon Printing Manager defined in PMApplication.h. The Carbon Printing Manager allows applications to print on Mac OS 8 with existing printer drivers and on Mac OS X with new printer drivers.
The following is a summary of the major changes you need to be aware of. More information is available on the Carbon website: <http://developer.apple.com/macosx/carbon/>
* The Print Record (TPrint) is no longer directly accessible by applications, and has been split into two separate opaque objects: a PrintSettings object and a PageFormat object. Applications will be given references to these two privately-defined data structures. These references are then used to query the Printing Manager for information contained within the objects.
* A consequence of splitting the Print Record and making it private is there are no fixed sizes. Applications will be able to "extend" both the PrintSettings and PageFormat objects, but applications must not assume a specific size when storing and retrieving a PageFormat with documents.
* The Printing Manager will supply functions for flattening and restoring both the PrintSettings and PageFormat object. When storing printing information with documents it will suffice to store just the PageFormat object. If older versions of your application store a print record with a saved document, you may continue to do so to provide backward compatibility.
* Application developers should reduce the use of calls that append items to print dialogs. We expect to provide a new panel-based interface in the near future.
* All print records use the "draft" style, not the "deferred" style, which implies that a print driver must handle the spooling if it wants to provide spooling for the user. Many, if not all, print drivers perform their own spooling and don't require applications to call PrPicFile() to implement spooling. Because it is rarely used, we are eliminating system level spooling code from the Printing Manager.
* The Printing Manager will now enforce an order in which some routines are called. Any routine used out of scope will return an error.
* All Printing Manager routines are only valid within a PMBegin/PMEnd block.
* PrintSettings and PageFormats are automatically disposed of during a PMEnd call.
* The desktop printing functions defined in DesktopPrinting.h are not supported in Carbon.
CallDTPAsyncErrorNotificationProc
DisposeDTPAsyncErrorNotificationUPP
DTPAsyncErrorNotificationProcPtr
InvokeDTPAsyncErrorNotificationUPP
NewDTPAsyncErrorNotificationUPP
Replace PrClose withPMEnd . Not available in Carbon.Replace PrCloseDoc withPMEndDocument . Not available in Carbon.Replace PrClosePage withPMEndPage . Not available in Carbon.Use the Carbon Printing Manager functions to send print requests to the printer driver. Not available in Carbon.Replace PrDlgMain with a call toPMPrintDialogMain for a job dialog box or a call toPMPageSetUpDialogMain
for a style dialog box. Not available in Carbon.Carbon applications must use Carbon Printing Manager functions instead. Not available in Carbon.Not available in Carbon.Carbon applications must use Carbon Printing Manager functions instead. Not available in Carbon.To send various print requests to the printer driver, use the higher-level Carbon Printing Manager functions instead. Not available in Carbon.Replace PrError withPMError
. Not available in Carbon.Replace PrGeneral withPMGeneral . Not available in Carbon.Replace PrintDefault with calls toPMDefaultPageFormat andPMDefaultPrintSettings
. Not available in Carbon.Replace PrJobDialog withPMPrintDialog . Not available in Carbon.Replace PrJobInit withPMPrintDialogInit . Not available in Carbon.Not available in Carbon.Not available in Carbon.Not available in Carbon.Replace PrOpen withPMBegin. Not available in Carbon. Replace PrOpenDoc withPMBeginDocument . Not available in Carbon.Replace PrOpenPage withPMBeginPage . Not available in Carbon.This function is obsolete. Printer drivers must perform their own spooling. Not available in Carbon.Not available in Carbon.Replace PrSetError withPMSetError . Not available in Carbon.Replace PrStlDialog withPMPageSetUpDialog . Not available in Carbon.Replace PrStlInit withPMPageSetUpDialogInit . Not available in Carbon.Replace PrValidate with calls toPMValidatePageFormat andPMValidatePrintSettings
. Not available in Carbon.